<?php

namespace app\common\model\Subject;

use think\Model;

// 课程评论模型
class Comment extends Model
{
    protected $name = 'subject_comment';

    protected $autoWriteTimestamp = true;

    protected $createTime = 'createtime';

    protected $updateTime = false;

    // 联表查询用户
    public function business() {
        return $this->belongsTo('app\common\model\Business\Business', 'busid', 'id', [], 'LEFT')
            ->setEagerlyType(0);
    }

    // 联表查询课程
    public function subject() {
        return $this->belongsTo('app\common\model\Subject\Subject', 'sub    id', 'id', [], 'LEFT')
            ->setEagerlyType(0);
    }
}